package com.aidex.biz.controller;

import com.aidex.biz.domain.bo.HomeBo;
import com.aidex.biz.service.HomeService;
import com.aidex.common.annotation.Log;
import com.aidex.common.core.controller.BaseController;
import com.aidex.common.core.domain.R;
import com.aidex.common.enums.BusinessType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/biz/bizHome")
public class HomeController extends BaseController {
    @Autowired
    private HomeService homeService;


    /**
     * 首页统计 box
     *
     * @param homeBo
     * @return
     */
    @Log(title = "首页统计", businessType = BusinessType.SELECT)
    @GetMapping("/getDataBoxInfo")
    public R getDataBoxInfo(HomeBo homeBo) {
        return R.data(homeService.getDataBoxInfo(homeBo));
    }

    /**
     * 首页统计 数据简报
     *
     * @param homeBo
     * @return
     */
    @Log(title = "首页统计 数据简报", businessType = BusinessType.SELECT)
    @GetMapping("/getShortDataInfo")
    public R getShortDataInfo(HomeBo homeBo) {
        return R.data(homeService.getShortDataInfo(homeBo));
    }


    /**
     * 首页统计 个人排行榜
     *
     * @param homeBo
     * @return
     */
    @Log(title = "首页统计 员工排行", businessType = BusinessType.SELECT)
    @GetMapping("/indexPaiHangBangSelf")
    public R indexPaiHangBangSelf(HomeBo homeBo) {
        return R.data(homeService.indexPaiHangBangSelf(homeBo));
    }


    /**
     * 首页统计 部门排行榜
     *
     * @param homeBo
     * @return
     */
    @Log(title = "首页统计 部门排行", businessType = BusinessType.SELECT)
    @GetMapping("/indexPaiHangBangDept")
    public R indexPaiHangBangDept(HomeBo homeBo) {
        return R.data(homeService.indexPaiHangBangDept(homeBo));
    }

    /**
     * 首页统计 快捷操作
     *
     * @param homeBo
     * @return
     */
    @Log(title = "首页统计 快捷操作", businessType = BusinessType.SELECT)
    @GetMapping("/getKuaiJieDataInfo")
    public R getKuaiJieDataInfo(HomeBo homeBo) {
        return R.data(homeService.getKuaiJieDataInfo(homeBo));
    }
}
